<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../dist/vue.js"></script>
    <div id="app">
        <!-- 语法糖 组件的双向绑定的语法糖 -->
        <my :title.sync="title"></my>
    </div>
    <script>
        const vm = new Vue({ // 父组件 
            el: '#app',
            components:{
                my:{
                    props:{
                        title:String
                    },
                    template:`<div>{{title}} <button @click="$emit('update:title','world')"></button></div>`    
                }
            },
            data:{
                title:'hello'
            },
            
        });
        // {~once &passive !passive}
      </script>
</body>

</html>